/**
 * Copyright (c) 2017 ShopJsp. All Rights Reserved.
 * ============================================================================
 * 版权所有 2011 - 今 北京华宇盈通科技有限公司，并保留所有权利。
 * ----------------------------------------------------------------------------
 * 提示：在未取得SHOPJSP商业授权之前，您不能将本软件应用于商业用途，否则SHOPJSP将保留追究的权力。
 * ----------------------------------------------------------------------------
 * 官方网站：http://www.shopjsp.com
 * ============================================================================
 * @author 张丁方
 * @CreateTime 2017-3-31 10:40:19
 */
package com.hyyt.shopjsp.callcenter.service.imp;

import com.hyyt.shopjsp.callcenter.dao.ShopCustomerServiceDAO;
import com.hyyt.shopjsp.callcenter.pojo.ShopCustomerService;
import com.hyyt.shopjsp.callcenter.service.IShopCustomerServiceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import org.apache.log4j.Logger;

@Service
public class ShopCustomerServiceService implements IShopCustomerServiceService {
    private static  final Logger logger = Logger.getLogger(IShopCustomerServiceService.class);

    @Resource
    private ShopCustomerServiceDAO shopCustomerServiceDAO;

    /**
     * 保存SHOP_客服表
     *
     * @param shopCustomerService SHOP_客服表
     * @return 保存后的SHOP_客服表
     */
    @Override
    public void saveShopCustomerService(ShopCustomerService shopCustomerService) {
        shopCustomerServiceDAO.insert(shopCustomerService);
    }

    /**
     * 更新SHOP_客服表
     *
     * @param shopCustomerService SHOP_客服表
     * @return 更新后的SHOP_客服表
     */
    @Override
    public void updateShopCustomerService(ShopCustomerService shopCustomerService) {
        shopCustomerServiceDAO.update(shopCustomerService);
    }

    /**
     * 删除指定ID的SHOP_客服表
     *
     * @param id SHOP_客服表ID
     */
    @Override
    public void deleteShopCustomerService(Integer id) {
        shopCustomerServiceDAO.delete(id);
    }

    /**
     * 删除指定ID集合的SHOP_客服表
     *
     * @param ids SHOP_客服表ID集合
    */
    public void deleteShopCustomerService(Collection<Integer> ids){
        shopCustomerServiceDAO.batchDelete(ids);
    }

    /**
     * 根据ID加载一个SHOP_客服表
     *
     * @param id SHOP_客服表ID
     * @return SHOP_客服表
     */
    @Override
    public ShopCustomerService loadShopCustomerService(Integer id) {
        return shopCustomerServiceDAO.load(id);
    }

    /**
    * 查询所有的SHOP_客服表，通常有最多取30000条记录的限制
    *
    * @return 所有的SHOP_客服表，通常有最多取30000条记录的限制
    */
    @Override
    public List<ShopCustomerService> queryAllShopCustomerService() {
        return shopCustomerServiceDAO.queryAll();
    }

    /**
     * 查询SHOP_客服表
     *
     * @param params 查询参数，为key-value形式
     * @return SHOP_客服表集合
     */
    @Override
    public List<ShopCustomerService> queryShopCustomerService(Map<String, Object> params) {
        return shopCustomerServiceDAO.query(params);
    }

    /**
     * 自定义查询SHOP_客服表 列表
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @param startRow 起始行数（不含起始行的数据）
     * @param rowSize  要查询记录数
     * @return SHOP_客服表集合
     */
    @Override
    public List<Map<String, Object>> queryShopCustomerService(Map<String, Object> params, int startRow, int rowSize) {
        return shopCustomerServiceDAO.query("query_scs",params, startRow, rowSize);
    }

    /**
     * 自定义查询SHOP_客服表 详情
     *
     * @param params   查询参数，没有则传null
     * @return SHOP_客服表集合
     */
    @Override
    public List<Map<String, Object>> queryShopCustomerServiceDetail(Map<String, Object> params) {
        return shopCustomerServiceDAO.query("query_scsDetail",params);
    }

    /**
     * 自定义统计SHOP_客服表
     *
     * @param params 查询参数，没有则传null,分页参数key为“sortColumns”
     * @return 结果集记录数
     */
    @Override
    public int countShopCustomerService(Map<String, Object> params) {
        return shopCustomerServiceDAO.count("count_scs",params);
    }
}